package com.kaifamiao.high.reflect;

import java.util.List;

/**
 * @author lucien-ma
 * @date 2021/10/7
 * @apiNote
 */
public class DBUtilsTest {
    public static void main(String[] args) {
        DBUtils<User> dbUtils = new DBUtils<>();
        List<User> users = dbUtils.selectList("select * from users", User.class, null);
        for (User user : users) {
            System.out.println(user);
        }
        System.out.println("----------------");
        User user = dbUtils.selectOne("select * from users where id = ?", User.class, 2);
        System.out.println(user);

        // 关闭资源
        dbUtils.close();
    }
}
